const whiteList = ['/login']

export function createRouterGuards(router){
    router.beforeEach((to, from, next) => {
        if (whiteList.includes(to.path)) {
            return next()
        }
        let token = sessionStorage.getItem('token')
        if (token !=  null) {
            return next()
        }else {
            return next('/login')
        }
    })
}
